﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="classManage.aspx.cs" Inherits="学生成绩查询及选课系统.admin.classManage" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
     <title>学生成绩查询及选课系统</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" href="../css/font.css"/>
    <link rel="stylesheet" href="../css/xadmin.css"/>
    <link href="./StyleSheet1.css" rel="stylesheet" />
    <!-- <link rel="stylesheet" href="./css/theme5.css"> -->
    <script src="../lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="../js/xadmin.js"></script>
    
</head>
<body>

    <div >
        <form id="form1" runat="server" >

        <br />
        <asp:Label ID="Label1" runat="server" Text="班级号"></asp:Label>
        :
        <asp:TextBox ID="TextBox1" CssClass="layui-input-inline" runat="server"></asp:TextBox>
&nbsp;
        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" CssClass="layui-btn-sm"  Text="查找" />
        <br />
        <br />
        <asp:GridView ID="GridView1"  runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" DataKeyNames="classno" DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None" OnRowCommand="GridView1_RowCommand" Height="329px" Width="576px">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:BoundField DataField="classno" HeaderText="班级号" ReadOnly="True" SortExpression="classno" />
                <asp:BoundField DataField="classname" HeaderText="班级名" SortExpression="classname" />
                <asp:BoundField DataField="clastate" HeaderText="班级状态" SortExpression="clastate" />
                <asp:CommandField ShowEditButton="True" />
                <asp:ButtonField CommandName="Insert" Text="添加" />
                
                <asp:HyperLinkField FooterText="添加" HeaderText="操作" />
                
            </Columns>
            <EditRowStyle BackColor="#7C6F57" />
            <EmptyDataTemplate>
                <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" BackColor="White" BorderColor="#336666" BorderStyle="Double" BorderWidth="3px" CellPadding="4" DataKeyNames="classno" DataSourceID="SqlDataSource1" DefaultMode="Insert" GridLines="Horizontal" Height="50px" OnItemCommand="DetailsView1_ItemCommand" OnItemInserted="DetailsView1_ItemInserted" Width="286px">
                    <EditRowStyle BackColor="#339966" Font-Bold="True" ForeColor="White" />
                    <Fields>
                        <asp:BoundField DataField="classno" HeaderText="班级号" ReadOnly="True" SortExpression="classno" />
                        <asp:BoundField DataField="classname" HeaderText="班级名" SortExpression="classname" />
                        <asp:BoundField DataField="clastate" HeaderText="班级状态" SortExpression="clastate" />
                        <asp:CommandField ShowInsertButton="True" />
                    </Fields>
                    <FooterStyle BackColor="White" ForeColor="#333333" />
                    <HeaderStyle BackColor="#336666" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#336666" ForeColor="White" HorizontalAlign="Center" />
                    <RowStyle BackColor="White" ForeColor="#333333" />
                </asp:DetailsView>
            </EmptyDataTemplate>
            <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#E3EAEB" />
            <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F8FAFA" />
            <SortedAscendingHeaderStyle BackColor="#246B61" />
            <SortedDescendingCellStyle BackColor="#D4DFE1" />
            <SortedDescendingHeaderStyle BackColor="#15524A" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:C#StuentManageConnectionString3 %>" DeleteCommand="DELETE FROM [class] WHERE [classno] = @classno" InsertCommand="INSERT INTO [class] ([classno], [classname], [clastate]) VALUES (@classno, @classname, @clastate)" SelectCommand="SELECT * FROM [class]" UpdateCommand="UPDATE [class] SET [classname] = @classname, [clastate] = @clastate WHERE [classno] = @classno">
            <DeleteParameters>
                <asp:Parameter Name="classno" Type="String" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="classno" Type="String" />
                <asp:Parameter Name="classname" Type="String" />
                <asp:Parameter Name="clastate" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="classname" Type="String" />
                <asp:Parameter Name="clastate" Type="String" />
                <asp:Parameter Name="classno" Type="String" />
            </UpdateParameters>
        </asp:SqlDataSource>
    </form>
    </div>
    
</body>
</html>
